﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="buscarPostNew.aspx.cs" Inherits="UI.buscarPostNew" MasterPageFile="~/wiki.Master"%>


<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID = "contentBuscarPostNew" runat="server" ContentPlaceHolderID="ContentPlaceHolder">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
<h2> Buscar Post New</h2>
<br />
    <table style="width: 100%">
        <tr>
            <td>
                Palavra-Chave:</td>
            <td style="width: 245px">
                <asp:TextBox ID="txtConteudo" runat="server" Width="190px"></asp:TextBox>
            </td>
            <td>
                Data &lt;=</td>
            <td>
                <asp:TextBox ID="txtData" runat="server" Width="100px"></asp:TextBox>
                <cc1:CalendarExtender ID="txtData_CalendarExtender" runat="server" 
                    Enabled="True" TargetControlID="txtData" Format="dd/MM/yyyy">
                </cc1:CalendarExtender>
            </td>
        </tr>
        <tr>
            <td>
                Usuário:</td>
            <td style="width: 245px">
                <asp:TextBox ID="txtUsuario" runat="server" Width="190px"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        </table>
        <table style="width: 100%">
        <tr>
            <td>
            <asp:CheckBoxList ID="cblTags" runat="server" RepeatDirection="Horizontal" 
                                style="font-size: 9pt" DataTextField="descricao" 
                    DataValueField="idTag" oninit="cblTags_Init">
            </asp:CheckBoxList>
           </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btPesquisa" runat="server" CssClass="botao" Text="Procurar" 
                    onclick="btPesquisa_Click" />
           </td>
        </tr>
    </table>
    <br />
    <asp:UpdateProgress ID="UpdateProgress" runat="server" 
        AssociatedUpdatePanelID="upPostNew" DisplayAfter="10">
        <ProgressTemplate>
            <img alt="" src="Images/carregando.gif" 
    style="width: 16px; height: 16px" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="upPostNew" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gvPostNew" runat="server" AutoGenerateColumns="False" 
                CellPadding="4" DataKeyNames="idPostNew" 
                EmptyDataText="Nenhuma Pos New encontrada!" ForeColor="#333333" 
                GridLines="None" style="font-size: 10pt" Width="480px">
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <Columns>
                    <asp:TemplateField HeaderText="Data Postagem">
                        <ItemTemplate>
                            <%# Eval("data") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Usuário">
                        <ItemTemplate>
                            <%# Eval("Usuario.nome") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Titulo">
                        <ItemTemplate>
                            <a href='visualizarPostNew.aspx?idPostNew=<%# Eval("idPostNew") %>'>
                            <%# Eval("titulo") %></a> <%--<%# Eval("titulo") %>--%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Qtd. Lidas">
                        <ItemTemplate>
                            <%# Eval("qtdLidas") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#999999" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btPesquisa" EventName="Click">
            </asp:AsyncPostBackTrigger>
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>